var auditState,auditReason,enterMembercert,enterAuditreport,enterLicense,enterProductcert;
var url = location.search; //获取url中"?"符后的字串 
$(function(){
    if (url.indexOf("?") != -1) { 
        var str = decodeURI(url.substr(1)); 
        var theRequest = new Object(); 
        var strs = str.split("&"); 
        for(var i = 0; i < strs.length; i ++) { 
            theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]); 
        } 
        auditState = theRequest.auditState;
        auditReason = theRequest.auditReason;
    }
    if(auditState == "等待审核"){
        $('.defeat-reason-box').hide();
        $('.submit-result').html('提交成功，请等待审核！');
        $('.small-submit-result').html('预计1个工作日内审核完毕，请耐心等待。');
        $('#submit-pic').attr('src',$().AbsUrlParse("/static/page/images/img_audit_ing@3x.png"));
        $('.pic-width').attr('src',$().AbsUrlParse("/static/page/images/img_ing@3x.png"));
        $('#submit-back').addClass('background-gradient');
        $('.clickBtn').hide();
    } else if(auditState == '审核通过'){
        $('.defeat-reason-box').hide();
        $('.submit-result').html('恭喜，您已通过初赛！');
        $('.small-submit-result').html('请上传复赛资料');
        $('#submit-pic').attr('src',$().AbsUrlParse("/static/page/images/img_audit_success@3x.png"));
        $('.pic-width').attr('src',$().AbsUrlParse("/static/page/images/img_success@3x.png"));
        $('#submit-back').addClass('background-gradient-green');
        $('.clickBtn').html('上传资料');
    } else if(auditState == "审核失败"){
        $('.submit-result').html('抱歉，您的审核资料未通过！');
        $('.small-submit-result').html('请修改您的资料，重新上传');
        $('.defeat-reason-box').show();
        $('.defeat-reason').html(auditReason);
        $('#submit-pic').attr('src',$().AbsUrlParse("/static/page/images/img_audit_failure@3x.png"));
        $('.pic-width').attr('src',$().AbsUrlParse("/static/page/images/img_failure@3x.png"));
        $('#submit-back').addClass('background-gradient-red');
        $('.clickBtn').html('修改资料');
    } else {
        $('.defeat-reason-box').hide();
        $('.submit-result').html('提交成功！');
        $('.small-submit-result').html('您已成功进入复赛，请耐心等待评分结果。');
        $('#submit-pic').attr('src',$().AbsUrlParse("/static/page/images/img_audit_success@3x.png"));
        $('.pic-width').attr('src',$().AbsUrlParse("/static/page/images/img_success@3x.png"));
        $('#submit-back').addClass('background-gradient');
        $('.clickBtn').hide();
    }
})
$(document).on("click", ".clickBtn", function () {
    var textType = $(this).html();
    if(textType == '上传资料'){
        // 审核成功上传资料
        window.location.href = $().AbsUrlParse("/web/page/uploadMessage");
        // window.location.href = "upload-message.html";
    } else {
        // 审核失败
        window.location.href = $().AbsUrlParse("/web/page/indextwo");
        // window.location.href = "upload-message.html";
    }
})